package autoz.core;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;

public class UserNotification implements Runnable {
	private String message;
	private MessageType type;
	
	public enum MessageType {ERROR, WARNING, INFORMATION};

	public UserNotification(String message, MessageType type){
		this.message = message;
		this.type = type;
	}
	public void run(){

		switch(type){
			case ERROR:
				MessageDialog.openError(Display.getDefault().getActiveShell(), 
						"AUtoZ Error", message);
				break;
			case INFORMATION:
				MessageDialog.openInformation(Display.getDefault().getActiveShell(), 
						"AUtoZ Information", message);
				break;
			case WARNING:
				MessageDialog.openWarning(Display.getDefault().getActiveShell(), 
						"AUtoZ Warning", message);
				break;
		}
	}

}
